<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .main {
            display: flex;
        }
        .left,
        .right {
            height: 300px;
            border: 1px solid red;
            box-sizing: border-box;
        }

        .left{
            width: 100%;
        }

        .right{
            width: 300px;
        }
    </style>
</head>
<body>
<div class="main">
    <div class="left">自适应宽度</div>
    <div class="right">固定宽度300px</div>
</div>
</body>
</html>